package com.bdqn.design;

import com.bdqn.design.factory.AbstractFactory;
import com.bdqn.design.factory.PersonDaoSQLLineFactory;
import com.bdqn.reflect.dao.PersonDao;
import com.bdqn.reflect.service.PersonService;
import com.bdqn.reflect.service.impl.PersonServiceImpl;

/**
 * Test02AbstractDaoFactory
 *
 * @author LILIBO
 * @since 2024/7/4
 */
public class Test02AbstractDaoFactory {

    public static void main(String[] args) {

        // 获取创建PersonDaoMySQL版本实例的工厂
        AbstractFactory factory = new PersonDaoSQLLineFactory();
        // 创建PersonDaoMySQL版本的实例
        PersonDao personDao = factory.getInstance();

        PersonService personService = new PersonServiceImpl(personDao);

        personService.list();
    }

}
